export default {
  state: {
    deviceCastObject: JSON.parse(sessionStorage.getItem('deviceCastObject')) || {}
  },
  mutations: {
    SET_DEVICE_CAST_OBJECT(state, deviceCastObject) {
      state.deviceCastObject = deviceCastObject;
      sessionStorage.setItem('deviceCastObject', JSON.stringify(deviceCastObject));
    }
  },
  actions: {
    setDeviceCastObject({commit, state}, deviceCastObject) {
      commit('SET_DEVICE_CAST_OBJECT', deviceCastObject);
    }
  }
};
